﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LetiLib.Security.Cryption
{
    
    public class XORCryptor 
    {
        private static readonly byte XORSymbol = 0xAB;

        public static byte[] Encrypt(byte[] input) {
            byte[] output = (byte[])input.Clone();
            // XOR cypher
            for (int i = 0; i < output.Length; i++)
                output[i] ^= XORSymbol;

            return output;
        }
        public static byte[] Decrypt(byte[] input) {
            byte[] output = (byte[])input.Clone();
            // XOR cypher
            for (int i = 0; i < output.Length; i++)
                output[i] ^= XORSymbol;

            return output;
        }
    }
}
